import request from ".";
interface ApiResponse<T = unknown> {
    code: number,
    data: T,
    message: string
}
export const getI18nData = <T>(params: { current: string, currentSize: string }) => {
    const query = new URLSearchParams(params).toString()
    return request.get(`/i18n/list?${query}`) as Promise<ApiResponse<T>>
}

export const getI18nDelete = <T>(code: string) => {
    return request.delete(`/i18n/delete/${code}`) as Promise<ApiResponse<T>>
}



interface I18nData {
  code: string,
  remarks: string,
  languageTexts: { languageTag: string, message: string }[]
}

export const getI18nUpdata = <T>(data: I18nData) => {
    return request.post('/i18n/update', data) as Promise<ApiResponse<T>>;
};